#define  _CRT_SECURE_NO_WARNINGS 1

int cmp(void* e1, void* e2)
{
    return *(int*)e1 - *(int*)e2;
}

int runeReserve(int* runes, int runesSize) {
    qsort(runes, runesSize, sizeof(runes[0]), cmp);
    int max = 0, count = 1;
    for (int i = 0; i < runesSize - 1; i++)
    {
        if (runes[i + 1] - runes[i] <= 1)
        {
            count++;
        }
        else
        {
            max = max > count ? max : count;
            count = 1;
        }
    }

    return max > count ? max : count;
}